package net.zoneland.zrdp.framework.config;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class JasyptPasswordDemo {
    /**
    * Logger for this class.
    */
    private static final Logger logger = LoggerFactory.getLogger(JasyptPasswordDemo.class);

    public static void main(final String[] args) {
        if (args == null || args.length != 2) {
            logger.warn("required args.length == 2");
            return;
        }
        final JasyptConfig jasyptConfig = new JasyptConfig();
        jasyptConfig.setJasyptPassword(args[0]);
        logger.info("input: {}", args[1]);
        final String encrypted = jasyptConfig.stringEncryptor().encrypt(args[1]);
        logger.info("output: {}", encrypted); //$NON-NLS-1$ //$NON-NLS-2$
    }
}
